package com.travelmood.service;

import com.travelmood.mapper.MoodMapper;
import com.travelmood.pojo.Mood;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MoodService {

    @Autowired
    private MoodMapper moodMapper;

    public void addMood(Mood mood) {
        moodMapper.insertMood(mood);
    }

    public void updateMood(Mood mood) {
        moodMapper.updateMood(mood);
    }

    public void deleteMoodById(Integer moodId) {
        moodMapper.deleteMoodById(moodId);
    }

    public Mood findMoodById(Integer moodId) {
        return moodMapper.findMoodById(moodId);
    }

    public List<Mood> getAllMoods() {
        return moodMapper.selectAllMoods();
    }

    public List<Mood> findMoodsByPlaceId(Integer placeId) {
        return moodMapper.findMoodsByPlaceId(placeId);
    }
}

